package com.szpx.service.impl;

import com.szpx.entity.Order;
import com.szpx.mapper.OrderMapper;
import com.szpx.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wgg
 * @version 1.0.0
 * @title OrderServiceImpl
 * @create 2024/4/10 11:11
 * @description
 **/
@Service
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;


    @Override
    public Order selectOrderById(Integer id) {
        return orderMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Order> selectAllOrder() {
        return orderMapper.selectAll();
    }

    @Override
    public int addOrder(Order order) {
        return orderMapper.insertSelective(order);
    }

    @Override
    public int deleOrder(Integer id) {
        return orderMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateOrder(Order order) {
        return orderMapper.updateByPrimaryKeySelective(order);
    }

    @Override
    public List<Order> getListByO(Order order) {
        return orderMapper.getListByO(order);
    }
}
